#ifndef PROCESS_INJECTOR_H_
#define PROCESS_INJECTOR_H_

#include <string>
#include <memory>
#include "tools/defSingleton.h"

namespace sd
{
namespace prin
{
namespace impl
{
class ProcessImpl;
class ProcessInjectorImpl;
}//impl




class Process
{
public:
    void Inject( const std::wstring&, const std::wstring& params =std::wstring() );
    std::wstring getName()const;
    int getId()const;
    std::wstring getCmd()const;


	bool isStarted()const;
	void start()const;

	Process( std::auto_ptr<impl::ProcessImpl>& impl):impl_(impl.release()){}
	Process():impl_(0){}


private:
    impl::ProcessImpl* impl_;
};


class ProcessInjector: public tools::defSingleton<ProcessInjector>
{
public:
    Process createProcess(const std::wstring& name);
    Process attachToProcess( int uid );
	ProcessInjector();
private:
	impl::ProcessInjectorImpl& impl_;
};





}//prin
}//sd




#endif//PROCESS_INJECTOR_H_